from openpyxl import load_workbook


class Excel_Data_Update:
    """
        读取更新成功的数据
    """
    @staticmethod
    def read_update_success():
        wb = load_workbook(r"/WebAppTest/WebTest/WebAutomationEncapsulation/CaseFiles/updateuser_demo.xlsx")
        st = wb['更新用户成功']
        data = [[st.cell(row=i,column=j).value for j in range(1,8)] for i in range(2,st.max_row+1)]
        return data
    
    """
        读取真实姓名错误的数据
    """
    @staticmethod
    def read_update_realname_error():
        wb = load_workbook(r"/WebAppTest/WebTest/WebAutomationEncapsulation/CaseFiles/updateuser_demo.xlsx")
        st = wb['真实姓名错误']
        data = [[st.cell(row=i,column=j).value for j in range(1,8)] for i in range(2,st.max_row+1)]
        return data
    """
        读取手机号错误的数据
    """
    @staticmethod
    def read_update_phonenun_error():
        wb = load_workbook(r"/WebAppTest/WebTest/WebAutomationEncapsulation/CaseFiles/updateuser_demo.xlsx")
        st = wb['手机号错误']
        data = [[st.cell(row=i,column=j).value for j in range(1,8)] for i in range(2,st.max_row+1)]
        return data
    """
        读取邮箱错误的数据
    """
    @staticmethod
    def read_update_email_error():
        wb = load_workbook(r"/WebAppTest/WebTest/WebAutomationEncapsulation/CaseFiles/updateuser_demo.xlsx")
        st = wb['邮箱错误']
        data = [[st.cell(row=i,column=j).value for j in range(1,8)] for i in range(2,st.max_row+1)]
        return data
    